From 3df73e00eb42244cc98e98daa8f1cfeaeb78f8b5 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 16 Dec 2016 12:54:47 -0800 Subject: [PATCH] Ignore dot dirs in directory sources Looks like they'll conflict with a VCS, so let's just skip them like we do in directory traversal elsewhere. Closes #3414 --- src/cargo/sources/directory.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cargo/sources/directory.rs b/src/cargo/sources/directory.rs index 96d06a8be..661cff6f9 100644 --- a/src/cargo/sources/directory.rs +++ b/src/cargo/sources/directory.rs @@ -71,6 +71,16 @@ impl<'cfg> Source for DirectorySource<'cfg> { for entry in entries { let entry = entry?; let path = entry.path(); + + // Ignore hidden/dot directories as they typically don't contain + // crates and otherwise may conflict with a VCS + // (rust-lang/cargo#3414). + if let Some(s) = path.file_name().and_then(|s| s.to_str()) { + if s.starts_with(".") { + continue + } + } + let mut src = PathSource::new(&path, &self.source_id, self.config); src.update()?; let pkg = src.root_package()?; -- 2.30.2